namespace AtomicCms.Common
{
    using System;
    using System.Security.Principal;
    using Entities;

    public class CmsPrincipal : IPrincipal
    {
        public CmsPrincipal(CmsUser identity)
        {
            this.cmsUserIdentity = identity;
        }

        private readonly CmsUser cmsUserIdentity;

        #region IPrincipal Members

        public bool IsInRole(string role)
        {
//            return cmsUserIdentity.IsInRole(role);
            // I have only one role now
            return true;
        }

        IIdentity IPrincipal.Identity { get { return cmsUserIdentity; } }

        #endregion
    }
}